package com.app.shop.adapters;

import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.app.shop.R;
import com.app.shop.beans.MessageBean;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;


public class  MessageAdapter extends BaseQuickAdapter<MessageBean, MessageAdapter.ViewHolder> {


    public MessageAdapter(int layout, @Nullable List<MessageBean> data) {
        super(layout, data);
    }


    @Override
    protected void convert(ViewHolder holder, MessageBean bean) {
        holder.tv_liuyan.setVisibility(View.GONE);
        holder.tv_name.setText(bean.getUser());
        holder.tv_time.setText(bean.getCreate_time());
        holder.tv_content.setText(bean.getContent());

    }


    public class ViewHolder extends BaseViewHolder {
        TextView tv_name;
        TextView tv_time;
        TextView tv_content;
        TextView tv_liuyan;


        public ViewHolder(View view) {
            super(view);
            tv_name = view.findViewById(R.id.tv_username);
            tv_time = view.findViewById(R.id.tv_time);
            tv_content = view.findViewById(R.id.tv_content);
            tv_liuyan = view.findViewById(R.id.tv_del_item);
        }
    }
}
